import { request } from "@/utils/service"
import type * as Users from "./types/users"

/** 增 */
export function createUsersDataApi(data: Users.CreateOrUpdateUsersRequestData) {
  return request({
    url: "member",
    method: "post",
    data
  })
}

/** 删 */
export function deleteUsersDataApi(ids: string) {
  return request({
    url: `member/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateUsersDataApi(data: Users.CreateOrUpdateUsersRequestData) {
  return request({
    url: "member",
    method: "put",
    data
  })
}

/** 查 */
export function getUsersDataApi(params: Users.GetUsersRequestData) {
  return request<Users.GetUsersResponseData>({
    url: "member",
    method: "get",
    params
  })
}
